package com.isaiah.util;

/**
 * @Title:
 * @Description:
 * @author: Haijun
 * @emial: isaiah@sohu.com
 * @date 2020/12/812:45
 */
public class ArrayUtil {

    public static <T>  void swap(int[] arr, int  i, int j ){
        if (i > arr.length){
            throw new IllegalArgumentException("i不能超过索引");
        }
        if (j > arr.length){
            throw new IllegalArgumentException("j不能超过索引");
        }
        int  temp =  arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }
}
